package com.itheima.work1124;

public class Hero {
    private String name;//名字
    private int hp;//生存
    private int att;//攻击
    private int pp;//效果
    double lifescores;

    public Hero(String name, int hp, int att, int pp) {
        this.name = name;
        this.hp = hp;
        this.att = att;
        this.pp = pp;
    }
    public Hero(){}

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getHp() {
        return hp;
    }

    public void setHp(int hp) {
        this.hp = hp;
    }

    public int getAtt() {
        return att;
    }

    public void setAtt(int att) {
        this.att = att;
    }

    public int getPp() {
        return pp;
    }

    public void setPp(int pp) {
        this.pp = pp;
    }
    public double lifescore() {
        return hp * 0.5 + att * 0.2 + pp * 0.3;
    }

    @Override
    public String toString() {
        return String.format("%s,%d,%d,%d,%.1f", name, hp, att, pp, lifescore());
    }
}
